import java.util.Arrays;

/**
 * @Author 12629
 * @Description：
 */
public class Test2 {
    public static int[] copy(int[] array) {
        int[] copyArray = new int[array.length];
        for (int i = 0; i < array.length; i++) {
            copyArray[i] = array[i];
        }
        return copyArray;
    }

    public static void main(String[] args) {
        int[] array1 = {1,2,3,4,5,6,7,8,9,10};
        //int[] array2 = copy(array1);
        int[] array2 = Arrays.copyOf(array1,array1.length*2);
        System.out.println(Arrays.toString(array2));
    }

    public static void main3(String[] args) {
        int[] array1 = {1,2,3,4,5,6,7,8,9,10};

        int[] array2 = array1;

        System.out.println(Arrays.toString(array2));
    }
    public static void main2(String[] args) {
        int[] array = new int[10];
        //Arrays.fill(array,9);
        Arrays.fill(array,3,6,9);
        System.out.println(Arrays.toString(array));
    }
    public static void main1(String[] args) {
        int[] array1 = {1,2,3,4,5,6,7,8,9,10};
        int[] array2 = {1,2,3,4,5,6,7,18,9,10};

        boolean ret = Arrays.equals(array1, array2);
        System.out.println(ret);
        //[3,6)
        /*int ret = Arrays.binarySearch(array,3,6,7);
        System.out.println(ret);*/
    }
}
